package com.zhoutao.blog.seven.model.converter;

import com.zhoutao.blog.seven.dao.model.BookChapterDao;
import com.zhoutao.blog.seven.model.response.BookChapter;
import org.springframework.stereotype.Component;

@Component
public class BookChapterConverter extends AbstractConverter<BookChapterDao, BookChapter> {
    @Override
    public BookChapter converterFrom(BookChapterDao bookChapterDao) {
        return new BookChapter()
                .setBookId(bookChapterDao.getBookId())
                .setId(bookChapterDao.getId())
                .setLevel(bookChapterDao.getLevel())
                .setOrdinal(bookChapterDao.getOrdinal())
                .setTitle(bookChapterDao.getTitle())
                .setType(bookChapterDao.getType())
                .setUrl(bookChapterDao.getUrl())
                .setCreatedAt(bookChapterDao.getCreatedAt());
    }

    @Override
    public BookChapterDao converterTO(BookChapter bookChapter) {
        return null;
    }
}
